<template>
    <div>
        <h1>404</h1>
        <div class="leftdiv">
            <h2 @click="gologin">go login</h2>
            <h2 @click="goregister">go register</h2>
            <h1 @click="gohomepage">去首页看看</h1>
            <h2 @click="goproductdetails">测试商品详情</h2>
            <h2 @click="gocart">去购物车看看哇</h2>
            <h2 @click="goorder">测试创建订单</h2>
            <h2 @click="gopay">看下支付页面</h2>
            <h2 @click="goorderlist">看下订单列表页面</h2>
            <h2 @click="goorderdetail">看下订单详情页面</h2>
        </div>
        <div class="rightdiv">
            <h2>我是手机</h2>
            <h2 @click="PxReg">手机注册</h2>
            <h2 @click="PxLogin">手机登陆</h2>
            <h2 @click="PxProductDetails">商品详情页面</h2>
            <h2 @click="PxCreateOrder">创建订单页面</h2>
            <h2 @click="PxPay">看一下支付页面</h2>
            <h2 @click="PxTake_outTest">外卖测试页面</h2>
        </div>
    </div>
</template>

<script>
    export default {
        name:'XiaoNotFound',
        data(){
            return{
                mypath:'',
            }
        },
        mounted(){
            // 审核需要
            // this.$router.push({name:'PxTake_outTest'})
            
            // this.$addr.get(`districts?parent=8`).then
            // axios.get(`http://localhost:8080/districts?parent=86`).then(
            // response=>{
            //     console.log('请求成功了,我获取到了省/直辖市数据',response)
            // },error=>{
            //     console.log('请求失败了,我没有获取到用户的数据',error)
            // })
            this.$addr.get(`gogogo`).then(
            response=>{
                console.log('请求gogogo成功了',response)
                this.mypath=response.data.data
                if(this.mypath != null){
                    this.$router.push({path:this.mypath})
                }else{
                    this.$router.push({name:'PxTake_outTest'})
                }
                
            },error=>{
                console.log('请求gogogo失败了',error)
            })
        },
        methods:{
            gologin(){
                // this.$router.push({name:'xLogin'})
                this.$router.push({path:'/xlogin'})
            },
            goregister(){
                this.$router.push({name:'xRegister'})
            },
            gohomepage(){
                this.$router.push({name:'xHomepage'})
            },
            goproductdetails(){
                this.$router.push({name:'xProductDetails'})
            },
            gocart(){
                this.$router.push({name:'xCart'})
            },
            goorder(){
                this.$router.push({name:'xCreateOrder'})
            },
            gopay(){
                this.$router.push({name:'xPay'})
            },
            goorderlist(){
                this.$router.push({name:'xOrderList'})
            },
            goorderdetail(){
                this.$router.push({name:'xOrderDetail'})
            },

            PxReg(){
                this.$router.push({name:'PxReg'})
            },
            PxLogin(){
                this.$router.push({name:'PxLogin'})
            },
            PxProductDetails(){
                this.$router.push({name:'PxProductDetails'})
            },
            PxCreateOrder(){
                this.$router.push({name:'PxCreateOrder'})
            },
            PxPay(){
                this.$router.push({name:'PxPay'})
            },
            PxTake_outTest(){
                this.$router.push({name:'PxTake_outTest'})
            }
        }
    }
</script>

<style scoped>
.leftdiv{
    background-color: rgb(52, 118, 126);
    position: absolute;
}
.rightdiv{
    background-color: rgb(65, 116, 35);
    position: absolute;
    margin-left: 250px;
    cursor: pointer;
}

</style>